package kk.yy.utilsdesign;

import android.annotation.SuppressLint;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import androidx.annotation.Nullable;

public class ServiceUtils extends Service{
    private String TAG="ServiceUtils";

    @Override
    public void onCreate() {
        Log.d(TAG, "ServiceDemo onCreate");
        MediaUtils.getInstance().start(this,"warm.mp3");
        super.onCreate();
    }

    @SuppressLint("WrongConstant")
    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.d(TAG, "ServiceDemo onStartCommand");
        flags = START_STICKY;
        return super.onStartCommand(intent, flags, startId);
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        Log.i(TAG, "onBind - Thread ID = " + Thread.currentThread().getId());
        return null;
    }

    @Override
    public void onDestroy() {
        Log.i(TAG, "onDestroy - Thread ID = " + Thread.currentThread().getId());
        super.onDestroy();
    }
}
